package com.mycompany.delivery.servicelayer;

import com.mycompany.delivery.dto.DeliveryDTO;
import com.mycompany.delivery.dto.UserDTO;
import com.mycompany.delivery.dto.DTOState;
import java.util.List;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author akaren
 */
public interface DeliveryService {
    /**
     * Creates delivery 
     * @param deliveryDTO
     */
    public DeliveryDTO create(DeliveryDTO p);

    /**
     * Updates existing delivery 
     * @param deliveryDTO 
     */
    public DeliveryDTO update(DeliveryDTO p);

     /**
     * Removes given delivery 
     * @param deliveryDTO 
     */
    public DeliveryDTO remove(DeliveryDTO p);

    /**
     * Gets delivery from the database with a given id
     * @param id
     * @return DeliveryService with given id
     */
    public DeliveryDTO find(Long id);
      
    /**
     * Adds delivery to courier's list of deliveries
     * @param UserDTO
     */    
    public void addDeliveryToCourier(DeliveryDTO d, UserDTO c);
  
     /**
     * Adds delivery to employee's list of deliveries
     * @param UserDTO
     */
    public void addDeliveryToEmployee(DeliveryDTO d, UserDTO e);
 
    /**
     * Deletes delivery from courier's list of deliveries
     * @param userDTO
     */  
    public void removeDeliveryFromCourier(DeliveryDTO d, UserDTO c);

     /**
     * Deletes delivery from employee's list of deliveries
     * @param userDTO
     */  
    public void removeDeliveryFromEmployee(DeliveryDTO d, UserDTO e);
    
    public List<DeliveryDTO> getDeliveriesByStateFromCourier(UserDTO u, DTOState s);
    
    public List<DeliveryDTO> getDeliveriesByStateFromEmployee(UserDTO u, DTOState s);
    
     /**
     * Returns all deliveries that exists in database and are unprocessed
     */  
    public List<DeliveryDTO> getDeliveriesInUnprocessedState();
    
     
     /**
     * Returns all deliveries that exists in database and are processed
     */  
    public List<DeliveryDTO> getDeliveriesInProcessedState();
    
      /**
     * Returns all deliveries without courier
     */        
    public List<DeliveryDTO> getDeliveriesWithoutCourier();
}
